home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / AppleScript.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  5.9 KB  |  201 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        AppleScript.a
  3. ;
  4. ;    Contains:    AppleScript Specific Interfaces.
  5. ;
  6. ;    Version:    Technology:    AppleScript 1.1
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1992-1997 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__APPLESCRIPT__') = 'UNDEFINED' THEN
  19. __APPLESCRIPT__ SET 1
  20.  
  21.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  22.     include 'Errors.a'
  23.     ENDIF
  24.     IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
  25.     include 'AppleEvents.a'
  26.     ENDIF
  27.     IF &TYPE('__OSA__') = 'UNDEFINED' THEN
  28.     include 'OSA.a'
  29.     ENDIF
  30.     IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
  31.     include 'TextEdit.a'
  32.     ENDIF
  33.  
  34. ; **************************************************************************
  35. ;    Types and Constants
  36. ;*************************************************************************
  37.  
  38. ;    The specific type for the AppleScript instance of the
  39. ;    Open Scripting Architecture type.
  40. ;
  41.  
  42.  
  43. typeAppleScript                    EQU        'ascr'
  44. kAppleScriptSubtype                EQU        'ascr'
  45. typeASStorage                    EQU        'ascr'
  46. ; **************************************************************************
  47. ;    Component Selectors
  48. ;*************************************************************************
  49.  
  50.  
  51.  
  52. kASSelectInit                    EQU        $1001
  53. kASSelectSetSourceStyles        EQU        $1002
  54. kASSelectGetSourceStyles        EQU        $1003
  55. kASSelectGetSourceStyleNames    EQU        $1004
  56.  
  57. ; **************************************************************************
  58. ;    OSAGetScriptInfo Selectors
  59. ;*************************************************************************
  60.  
  61.  
  62. kASHasOpenHandler                EQU        'hsod'
  63. ;        This selector is used to query a context as to whether it contains
  64. ;        a handler for the kAEOpenDocuments event. This allows "applets" to be 
  65. ;        distinguished from "droplets."  OSAGetScriptInfo returns false if
  66. ;        there is no kAEOpenDocuments handler, and returns the error value 
  67. ;        errOSAInvalidAccess if the input is not a context.
  68. ;    
  69.  
  70. ; **************************************************************************
  71. ;    Initialization
  72. ;*************************************************************************
  73.  
  74. ;
  75. ; pascal OSAError ASInit(ComponentInstance scriptingComponent, long modeFlags, long minStackSize, long preferredStackSize, long maxStackSize, long minHeapSize, long preferredHeapSize, long maxHeapSize)
  76. ;
  77.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  78.         Macro
  79.         _ASInit
  80.             move.l              #$001C1001,-(sp)
  81.             moveq               #0,D0
  82.             dc.w                $A82A
  83.         EndM
  84.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  85.         IMPORT_CFM_FUNCTION ASInit
  86.     ENDIF
  87.  
  88. ;        ComponentCallNow(kASSelectInit, 28);
  89. ;        This call can be used to explicitly initialize AppleScript.  If it is
  90. ;        not called, the a scripting size resource is looked for and used. If
  91. ;        there is no scripting size resource, then the constants listed below
  92. ;        are used.  If at any stage (the init call, the size resource, the 
  93. ;        defaults) any of these parameters are zero, then parameters from the
  94. ;        next stage are used.  ModeFlags are not currently used.
  95. ;        Errors:
  96. ;        errOSASystemError        initialization failed
  97. ;    
  98.  
  99. ;    These values will be used if ASInit is not called explicitly, or if any
  100. ;    of ASInit's parameters are zero:
  101. ;
  102.  
  103.  
  104. kASDefaultMinStackSize            EQU        4096
  105. kASDefaultPreferredStackSize    EQU        16384
  106. kASDefaultMaxStackSize            EQU        16384
  107. kASDefaultMinHeapSize            EQU        4096
  108. kASDefaultPreferredHeapSize        EQU        16384
  109. kASDefaultMaxHeapSize            EQU        33554432
  110. ; **************************************************************************
  111. ;    Source Styles
  112. ;*************************************************************************
  113.  
  114. ;
  115. ; pascal OSAError ASSetSourceStyles(ComponentInstance scriptingComponent, STHandle sourceStyles)
  116. ;
  117.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  118.         Macro
  119.         _ASSetSourceStyles
  120.             move.l              #$00041002,-(sp)
  121.             moveq               #0,D0
  122.             dc.w                $A82A
  123.         EndM
  124.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  125.         IMPORT_CFM_FUNCTION ASSetSourceStyles
  126.     ENDIF
  127.  
  128. ;        ComponentCallNow(kASSelectSetSourceStyles, 4);
  129. ;        Errors:
  130. ;        errOSASystemError        operation failed
  131. ;    
  132.  
  133. ;
  134. ; pascal OSAError ASGetSourceStyles(ComponentInstance scriptingComponent, STHandle *resultingSourceStyles)
  135. ;
  136.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  137.         Macro
  138.         _ASGetSourceStyles
  139.             move.l              #$00041003,-(sp)
  140.             moveq               #0,D0
  141.             dc.w                $A82A
  142.         EndM
  143.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  144.         IMPORT_CFM_FUNCTION ASGetSourceStyles
  145.     ENDIF
  146.  
  147. ;        ComponentCallNow(kASSelectGetSourceStyles, 4);
  148. ;        Errors:
  149. ;        errOSASystemError        operation failed
  150. ;    
  151.  
  152. ;
  153. ; pascal OSAError ASGetSourceStyleNames(ComponentInstance scriptingComponent, long modeFlags, AEDescList *resultingSourceStyleNamesList)
  154. ;
  155.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  156.         Macro
  157.         _ASGetSourceStyleNames
  158.             move.l              #$00081004,-(sp)
  159.             moveq               #0,D0
  160.             dc.w                $A82A
  161.         EndM
  162.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  163.         IMPORT_CFM_FUNCTION ASGetSourceStyleNames
  164.     ENDIF
  165.  
  166. ;        ComponentCallNow(kASSelectGetSourceStyleNames, 8);
  167. ;        This call returns an AEList of styled text descriptors the names of the
  168. ;        source styles in the current dialect.  The order of the names corresponds
  169. ;        to the order of the source style constants, below.  The style of each
  170. ;        name is the same as the styles returned by ASGetSourceStyles.
  171. ;        
  172. ;        Errors:
  173. ;        errOSASystemError        operation failed
  174. ;    
  175.  
  176. ;    Elements of STHandle correspond to following categories of tokens, and
  177. ;    accessed through following index constants:
  178. ;
  179.  
  180.  
  181. kASSourceStyleUncompiledText    EQU        0
  182. kASSourceStyleNormalText        EQU        1
  183. kASSourceStyleLanguageKeyword    EQU        2
  184. kASSourceStyleApplicationKeyword EQU    3
  185. kASSourceStyleComment            EQU        4
  186. kASSourceStyleLiteral            EQU        5
  187. kASSourceStyleUserSymbol        EQU        6
  188. kASSourceStyleObjectSpecifier    EQU        7
  189. kASNumberOfSourceStyles            EQU        8
  190.  
  191.     ENDIF ; __APPLESCRIPT__ 
  192.  
  193.